<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>首页</title>
    <link rel="stylesheet" type="text/css" href="/css/common.css" />
    <!-- 引入 layui.css -->
    <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">

    <!-- 引入 layui.js -->
    <script src="//unpkg.com/layui@2.6.8/dist/layui.js">

    </script>
</head>
<body>
<div class="divForm">
    <form class="layui-form" th:action="@{/login}" method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
                <input type="text" name="username" required  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
                <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即登录</button>
                <button type="reset" class="layui-btn ">重置</button>
            </div>
        </div>
    </form>
</div>

</body>
<style>
    *{
        margin:0;
        padding:0;
    }
    body{
        margin: 0;
        padding: 0;
        font-family: sans-serif;
        background: url("../static/images/1.png")  no-repeat center 0px;
        background-size: cover;



        background-position: center 0;
        background-repeat: no-repeat;
        background-attachment: fixed;
        -webkit-background-size: cover;
        -o-background-size: cover;
        -moz-background-size: cover;
        -ms-background-size: cover;

    }
    .divForm{
        position: absolute;/*绝对定位*/
        text-align: center;/*(让div中的内容居中)*/
        top: 50%;
        left: 50%;
        margin-top: -200px;
        margin-left: -150px;
    }
</style>
</html>


<!--<!DOCTYPE html>-->
<!--<html lang="en" xmlns:th="http://www.thymeleaf.org">-->
<!--<head>-->
<!--    <meta charset="UTF-8">-->
<!--    <title>登录页面</title>-->
<!--</head>-->
<!--<body>-->
<!--<form class="form-signin" role="form" th:action="@{/login}" th:method="post">-->
<!--    <input type="text" class="form-control" placeholder="用户名" required="required" name="username" />-->
<!--    <input type="password" class="form-control" placeholder="密码" required="required" name="password" />-->
<!--    <button class="btn btn-lg btn-warning btn-block" type="submit">登录</button>-->
<!--    <label class="checkbox">-->
<!--        <input type="checkbox" value="remember-me" /> 记住我-->
<!--    </label>-->
<!--</form>-->
<!--</body>-->
<!--</html>-->